<extend name="Public:innerbase" />
<block name="css">
<link rel="stylesheet" href="{:STATICS}/validation/css/validationEngine.jquery.css" />
<link type="text/css" rel="stylesheet" href="{:STATICS}/datetimepicker/css/bootstrap-datetimepicker.min.css" />
</block>
<block name="js">
<include file="Public:upload" />
<include file="Public:editor" />
<script type="text/javascript" src="{:STATICS}/validation/js/jquery.validationEngine.js"></script>
<script type="text/javascript" src="{:STATICS}/validation/js/jquery.validationEngine-zh_CN.js"></script>
<script type="text/javascript" src="{:STATICS}/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="{:STATICS}/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script>
$(function(){
	$("#editForm").validationEngine("attach",{ 
		promptPosition:"centerRight",
		scroll:true,
		showOneMessage:true
	});
	$(".datetime-picker").datetimepicker({format: 'yyyy-mm-dd',language:'zh-CN',minView:2,autoclose:true});
});
</script>
</block>
<block name="content">
<div class="container-fluid">
	<div class="page-header wm-page-header">
		<h4>导师信息</h4>
		<a href="{:U('Ski/coach')}" class="btn btn-default btn-sm">
			<span class="glyphicon glyphicon-chevron-left"></span>&nbsp;返回
		</a>
	</div>
	<form id="editForm" class="form-horizontal" method="post">
		<input type="hidden" name="id" value="{$set.id}" />
		<div class="form-group">
			<label class="col-sm-2">名称</label>
			<div class="col-md-3">
				<input type="text" name="name" value="{$set.name}" class="form-control validate[required,maxSize[10]]" />
				<span class="help-block">不要超过10个字符</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2">雪场</label>
			<div class="col-md-6">
				<volist name="fields" id="vo">
				<label class="checkbox-inline">
					<input type="checkbox" name="fields[]" <if condition="$vo['checked']">checked</if> value="{$vo.name}" />{$vo.name}
				</label>
				</volist>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2">名师等级</label>
			<div class="col-md-3">
				<select class="form-control" name="level">
					<option <eq name="set['level']" value="特级教练">selected</eq> value="特级教练">特级教练</option>
					<option <eq name="set['level']" value="高级教练">selected</eq> value="高级教练">高级教练</option>
					<option <eq name="set['level']" value="普通教练">selected</eq> value="普通教练">普通教练</option>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2">市场价格</label>
			<div class="col-md-3">
				<input type="text" name="normal_price" value="{$set.normal_price}" class="form-control validate[required]" />
				<span class="help-block">单位：元/天</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2">手机促销价格</label>
			<div class="col-md-3">
				<input type="text" name="price" value="{$set.price}" class="form-control validate[required]" />
				<span class="help-block">单位：元/天</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2">星级</label>
			<div class="col-md-2">
				<input type="text" name="stars" value="{$set.stars|default=0}" class="form-control" />
				<span class="help-block">值范围为1-5</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2">领证时间</label>
			<div class="col-md-3">
				<input type="text" name="certificate_time" value="{$set.certificate_time|default=time()|date='Y-m-d',###}" class="form-control datetime-picker" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2">导师类别</label>
			<div class="col-md-3">
				<select class="form-control" name="type">
					<option <eq name="set['type']" value="1">selected</eq> value="1">郝世花专职导师</option>
					<option <eq name="set['type']" value="2">selected</eq> value="2">郝世花教练联盟</option>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2">风采图片</label>
			<div class="col-sm-6" >
				<input type="hidden" class="form-control" value="{$set.img}" id="img" name="img" />
				<img id="imgHolder" style="width:216px;" class="img" <if condition="$set['img'] eq ''">src="{:RES}/images/photo/noneimg.jpg"</if> src="{$set.img}"/>
				<div class="btn-group" style="vertical-align:bottom;">
					<span class="btn btn-xs btn-primary" onclick="selectAsset('img',720,400)">
						<span class="glyphicon glyphicon-cloud-upload"></span>选择
					</span>
					<span class="btn btn-primary btn-xs" onclick="previewImg('img')">
						<span class="glyphicon glyphicon-picture"></span>预览
					</span>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2">手机号</label>
			<div class="col-md-3">
				<input type="text" name="cellphone" value="{$set.cellphone}" class="form-control"  />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2">身份证号</label>
			<div class="col-md-3">
				<input type="text" name="card_number" value="{$set.card_number}" class="form-control"  />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2">详细介绍</label>
			<div class="col-md-6">
				<textarea class="form-control" name="detail" id="content" rows="5" style="height:260px">{$set.detail}</textarea>
			</div>
		</div>
		<div class="form-group">
            <label class="col-sm-2">排序</label>
            <div class="col-md-3">
                <input type="text" id="sort" name="sort" value="{$set.sort|default=1}" class="form-control validate[required,custom[integer],min[1],max[255]" />
                <span class="help-block">范围1-255，越小越靠前</span>
            </div>
        </div>
		<div class="form-group">
			<div class="col-md-5 col-sm-offset-2">
				<input type="submit" class="btn btn-primary" value="保存" />
			</div>
		</div>
	</form>
</div>
</block>